package com.liuguang.testassert.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.liuguang.testassert.enums.CheckParamEnums;
import com.liuguang.testassert.enums.ResultFlag;
import com.liuguang.testassert.common.Result;
import com.liuguang.testassert.service.TestAssertService;
import org.springframework.stereotype.Service;

/**
 * @ClassName: TestAssertServiceImpl
 * @Description：
 * @Author: wanghr
 * Date: 5:05 PM 2020/5/29
 * Version: 1.0
 */
@Service
public class TestAssertServiceImpl implements TestAssertService {
    @Override
    public Result<JSONObject> testAssert(JSONObject jsonObject) {
        Result<JSONObject> result = new Result<>();
        String userName = jsonObject.getString("userName");
        CheckParamEnums.PARAM_IS_NULL.assertNotNull(userName);


        result.setCode(ResultFlag.SUCESS.getCode());
        result.setMsg(ResultFlag.SUCESS.getMsg());
        return result;
    }
}
